import requests
import threading

# 请求的URL
url = 'http://124.223.139.46:30001/api/withdrawals'

# 请求的头部信息
headers = {
    'authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJsaW4iLCJpYXQiOjE3MDk2MjY2NDMsImV4cCI6NDg2NTMwMDI0MywibmJmIjoxNzA5NjI2NjQzLCJqdGkiOiJHSXN5ZlRqMWQxalRUNjRPIiwic3ViIjoiand0IGF1dGgiLCJwcnYiOiI2MTM0MDBlZmIxYmZiNTBmOTZmOTBiM2VmZjNlYjFlNDlkZjRlODFkIiwidXNlcl9pZCI6IjcwNzgifQ.V8GxJHC3WQMa3PqHFPZvMtK34DLfrORSfTx3YMGRt38'
}

# 请求的表单数据
# 注意：这里假设所有的值都是固定的，如果有动态变化的字段，在实际应用中需要相应地进行调整
data = {
    'bank_account_id': '253',
    'user_id': '7078',
    'amount': '10000'
    # '_token': 'tRH18LXgnCccPez6fbl1PHSwNDmPRrVsLXQXMjA2'
}

def send_request():
    for i in range(5):
        response = requests.post(url, headers=headers, json=data)
        print(f"Thread {threading.current_thread().getName()} - Count: {i+1}")
        print(response.status_code)
        print(response.text)

# 创建两个线程
thread1 = threading.Thread(target=send_request)
thread2 = threading.Thread(target=send_request)
thread3 = threading.Thread(target=send_request)

# 启动线程
thread1.start()
thread2.start()
thread3.start()

# 等待两个线程结束
thread1.join()
thread2.join()
thread3.join()
